//
// Created by zhuyijun on 2021/8/17.
//

#ifndef BASE_STOCK20_H
#define BASE_STOCK20_H

#include <string>

class Stock {

private:
    std::string company;
    int shares;
    double share_val;
    double total_val{};

    void set_tot();

public:
    Stock();

    Stock(const std::string &co, long n = 0, double pr = 0.0);

    ~Stock();

    void buy(long num, double price);

    void sell(long num, double price);

    void update(double price);

    void show() const;

    const Stock &topval(const Stock &s) const;
};


#endif //BASE_STOCK20_H
